Re: Update with last known location?

Поиск
Список
Период
Сортировка
От Daniel Staal
Тема Re: Update with last known location?
Дата
Msg-id BCEA4C28269BB2ECF410A7E3@[192.168.1.50]
обсуждение исходный текст
Ответ на Re: Update with last known location?  (James David Smith <james.david.smith@gmail.com>)
Список pgsql-novice
--As of January 28, 2014 5:07:16 PM +0000, James David Smith is alleged to
have said:

>> If it's strictly a one-time thing, I personally would write it in Perl,
>> not SQL.  ;)  (Or whatever your  scripting language of choice is.)
>>
>> Which would allow you to change step 3 to 'If the_geom is blank, take
>> stored recent value for ppid and fill, then insert back into database.
>> Else, overwrite the_geom for this ppid.'  (A bit less convoluted than
>> yours, and avoids the problems with multiple nulls in a row, as well as
>> allowing you to only sort by point_time.)
>>
>>
>> Daniel T. Staal
>
> Hi Daniel,
>
> Given the data is so large I don't want to be taking the data out to a
> CSV or whatever and then loading it back in. I'd like to do this
> within the database using SQL. I thought I would be able to do this
> using a LOOP to be honest.

--As for the rest, it is mine.

I haven't played with LOOP, it might be able to do what you need.  But I'm
not saying pull the data into a CSV or anything: Perl's DBI has the ability
to iterate over a result set, pulling each value out of the database as
needed.  I'm sure other scripting languages have something similar.

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------


В списке pgsql-novice по дате отправления:

Предыдущее
От: James David Smith
Дата:
Сообщение: Re: Update with last known location?
Следующее
От: avpro avpro
Дата:
Сообщение: time with timezone for PostgreSql